import sqlite3
def getencode():
    try:
        conn = sqlite3.connect('reference.db')
        cursor = conn.cursor()
        sql = '''select sjmm from sjm limit 1'''
        results = cursor.execute(sql)
        one_sjm = results.fetchone()[0]
        sql = "delete from sjm where sjmm = '"+one_sjm+"'"
        print(sql)
        cursor.execute(sql)
        conn.commit()
        return one_sjm
    except ZeroDivisionError as err:  # as 加原因参数名称
            print('Exception: ', err)

print(getencode())